package publics.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name="enterprise_product")
public class EnterpriseProduct {//企业产品或服务
	
	private Integer id;//	Integer
	private Enterprise ent;
	private Integer name;//产品或服务名称	Variable characters(20)
	private Integer purpose;//主要用途	Variable characters(40)
	private Integer revenueOneYear;//最近一年销售额(元)	float
	private Integer grossProfit;//毛利率（%）	Float
	@Id
	@GeneratedValue
	@Column(name="Ent_pro_id")
	public Integer getId() {
		return id;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="Ent_id",nullable=false)
	public Enterprise getEnt() {
		return ent;
	}
	@Column(name="Ent_pro_name")
	public Integer getName() {
		return name;
	}
	@Column(name="Ent_pro_purpose")
	public Integer getPurpose() {
		return purpose;
	}
	@Column(name="Ent_pro_revenue_ayear")
	public Integer getRevenueOneYear() {
		return revenueOneYear;
	}
	@Column(name="Ent_pro_gross_profit")
	public Integer getGrossProfit() {
		return grossProfit;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public void setEnt(Enterprise ent) {
		this.ent = ent;
	}
	public void setName(Integer name) {
		this.name = name;
	}
	public void setPurpose(Integer purpose) {
		this.purpose = purpose;
	}
	public void setRevenueOneYear(Integer revenueOneYear) {
		this.revenueOneYear = revenueOneYear;
	}
	public void setGrossProfit(Integer grossProfit) {
		this.grossProfit = grossProfit;
	}

	
	public EnterpriseProduct() {
		super();
		// TODO Auto-generated constructor stub
	}

	public EnterpriseProduct(Integer id, Integer name, Integer purpose,
			Integer revenueOneYear, Integer grossProfit) {
		super();
		this.id = id;
		this.name = name;
		this.purpose = purpose;
		this.revenueOneYear = revenueOneYear;
		this.grossProfit = grossProfit;
	}

	public EnterpriseProduct(Integer id, Enterprise ent, Integer name,
			Integer purpose, Integer revenueOneYear, Integer grossProfit) {
		super();
		this.id = id;
		this.ent = ent;
		this.name = name;
		this.purpose = purpose;
		this.revenueOneYear = revenueOneYear;
		this.grossProfit = grossProfit;
	}

	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "EnterpriseProduct [ent=" + ent + ", grossProfit=" + grossProfit
				+ ", id=" + id + ", name=" + name + ", purpose=" + purpose
				+ ", revenueOneYear=" + revenueOneYear + "]";
	}
}
